package com.dongzili.common.disruptor.handler;

import com.dongzili.common.config.aspect.AsyncLogService;
import com.dongzili.common.config.aspect.LogPrintInfo;
import com.dongzili.common.disruptor.entity.MessageEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

// 处理日志类型的策略
@Slf4j
@Component
public class LogTypeHandler implements EventHandler<LogPrintInfo> {
    @Override
    public void send(MessageEvent<LogPrintInfo> event) {
        log.info("sequence:{} 处理日志类型事件: {}",event.getSequence(), event);
        AsyncLogService.logRequest(event.getData());

    }

    @Override
    public Class<?> getTypeParam() {
        return LogPrintInfo.class;
    }
}